var express = require("express");
var router = express.Router();

/* GET home page. */
router.get("/", function (req, res, next) {
  res.render("index", { title: "Express" });
});

router.get("/goods", (req, res) => {
  res.json([
    {
      remote_img:
        "http://img11.360buyimg.com/n7/jfs/t1/176862/21/19846/100375/611c6e20E08082bbe/ef6f9348663c0b8d.jpg",
      title: "华为畅享20 SE手机 幻夜黑 全网通(8+128G)碎屏险套装",
      price: "1699.00",
      shop: "华信通手机专营店",
      url: "https://item.jd.com/10026096602041.html",
      isZY: false,
      img: "/images/goods/ef6f9348663c0b8d.jpg",
      id: 176,
    },
    {
      remote_img:
        "http://img11.360buyimg.com/n7/jfs/t1/197593/27/7309/147329/61371285E4807c5d2/e2ff7abd79dbb2c7.jpg",
      title:
        "天语（K-Touch）T2 老人手机语音播报移动2G直板按键大字大声大屏超长待机老年学生备用功能手机 金色 ",
      price: "1569.00",
      shop: "天语手机京东自营官方旗舰店",
      url: "https://item.jd.com/5204046.html",
      isZY: false,
      img: "/images/goods/e2ff7abd79dbb2c7.jpg",
      id: 177,
    },
    {
      remote_img:
        "http://img14.360buyimg.com/n7/jfs/t1/86467/25/19111/174947/6143241fE9a8c73aa/1ce0c8e2b2ca5d56.png",
      title:
        "【2799起】OPPO Reno6 系列 oppo手机 全网通5g智能 opporeno5升级版 Reno6 星黛紫 8G+128GB 现货 官方标配【1年店铺延保+晒单50红包】",
      price: "99.00",
      shop: "头号卖家旗舰店",
      url: "https://item.jd.com/10033854050519.html",
      isZY: false,
      img: "/images/goods/1ce0c8e2b2ca5d56.png",
      id: 178,
    },
    {
      remote_img:
        "http://img11.360buyimg.com/n7/jfs/t1/73087/2/17211/175402/614161feE884af4db/149451f876d614ab.jpg",
      title: "华为畅享20se 手机 幻夜黑 8+128G 全网通（碎屏险套餐）",
      price: "",
      shop: "炜东电商旗舰店",
      url: "https://item.jd.com/10026003600746.html",
      isZY: false,
      img: "/images/goods/149451f876d614ab.jpg",
      id: 179,
    },
    {
      remote_img:
        "http://img12.360buyimg.com/n7/jfs/t1/78079/8/16696/147124/6141480dE6fa8b1ed/d0e24b3e4d1f90a5.jpg",
      title: "小米 红米Note10 Pro 5G手机 6G+128G 星纱 官方标配【晒单有礼】",
      price: "2799.00",
      shop: "疆界互联旗舰店",
      url: "https://item.jd.com/10030804733602.html",
      isZY: false,
      img: "/images/goods/d0e24b3e4d1f90a5.jpg",
      id: 180,
    },
  ]);
});

router.get('/duanzi', (req, res) => {
  res.json([
    {
      id: 1,
      name: '张三',
      text: '从前有个太监'
    },
    {
      id: 2, 
      name: '李四',
      text: '头号卖家旗舰'
    }
  ])
})

router.get('/movie', (req, res) => {
  res.json({
    code: '0000',
    msg: '操作成功',
    data: {
      id: 1,
      title: '西虹市首富',
      price: 19.9
    }
  })
})

module.exports = router;
